package IOBaseTest;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * Created by yexuan on 2018/3/11.
 */
public class FileReaderDemo {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("demo.txt");
//        int c = 0;
//        while ((c=fr.read())!=-1){
//            System.out.print((char)c);
//        }

        char[] c = new char[1024];
        int num = 0;
        while ((num = fr.read(c))!=-1){
            System.out.println(new String(c,0,num));
        }
        fr.close();
    }
}
